#include <ctype.h>
#include <string.h>
#include <kernel.h>
#include <stdio.h>

extern int mem_part_count;

extern memoryframe mem_part_info[];

void MyMain()
{
    int  k;
    int  i;
    char b[16];

    hardware_init();

    for (i = 0; i < mem_part_count; i++)
        {
        vga_out_cstr("Address: 0x");
        vga_out_cstr(itoh(mem_part_info[i].addr.addr32, b));
        vga_out_cstr("    Length: 0x");
        vga_out_cstr(itoh(mem_part_info[i].length.length32, b));
        vga_out_cstr("    type: 0x");
        vga_out_cstr(itoh(mem_part_info[i].type, b)+6);
        vga_out_cstr("\r\n");
        }

    while(1)
        {
        k = readkbd();
        if (k != -1)
            {
            vga_out_cstr(itoh(k, b));

            memset(b, 0, sizeof(b));

            strcpy(b, " - ");

            b[3] = k & 0xFF;

            vga_out_cstr(b);
            }
        asm_delay();
        }

    return;
}

